(1) Field of the Invention
This invention relates to a computer-readable recording medium containing a database copying program, and a database copying apparatus and method, for making a copy of a database. Especially, this invention relates to a computer-readable recording medium containing a database copying program, and a database copying apparatus and method, for making a copy of a database on a remote computer being connected over a network.
(2) Description of the Related Art
At present, computers are often used for various purposes, such as data processing in business. Therefore, loss of data in databases should be avoided. The databases may be copied in case computers storing the databases fail. By doing so, even when data stored in a usually used computer (hereinafter, referred to as host computer) is broken, the data can be recovered from the duplicate database. Especially, in case natural hazard or the like befalls and a host computer becomes unusable, for example, databases are copied on a computer at a distance (hereinafter, referred to as remote computer).
There are two methods for transferring data into a remote computer: a messaging method and a mirroring method. In the messaging method, a host computer explicitly transmits a message including data to software running on a remote computer. In the mirroring method, a middleware for managing the local disks of a host computer and the remote disks of a remote computer automatically copies data from the local disks onto the remote disks. There is such a middleware to be used in the mirroring method that holds a sequence of writing data between logical disks and makes a copy of the data on remote disks in this sequence (for example, refer to Japanese Unexamined Patent Publication No. 2003-167684). Use of such a dedicated middleware has an advantage in that data copy does not affect an application program running for data processing.
To recover data whenever a host computer fails, the databases (hereinafter, referred to as host databases) of the host computer and the duplicate databases (hereinafter, referred to as remote databases) of the remote computer should strictly maintain their consistency. The mirroring method causes a time lag between updates of original and duplicate databases. This cannot maintain strict consistency. To avoid this problem, the host computer may confirm whether a remote database has been updated every time when data is updated. Specifically, when the host computer updates a host database in response to a request from an application program, the host computer confirms that a remote database has been updated, and then returns a response of processing completion to the application program. This technique realizes simultaneous updates of both databases, however, has a drawback in that a response to the application program is delayed due to a network delay time and a time required for updating the remote database.
There is a known method in which only update data that is information on update of a host database is transmitted to a remote computer and the remote computer updates a corresponding remote database based on the update data later (for example, refer to Japanese Unexamined Patent Publication No. 6-214853). In this connection, the host computer transmits the update data to the remote computer when updating the host database. The remote computer keeps the received update data and acknowledges its reception to the host computer, rather than updating the remote database immediately. Then the remote computer updates the remote database upon reception of a request for reflecting the update data on the remote database from the host computer. This method allows the host computer to continue the processing when receiving the acknowledgement of update data reception from the remote computer. It takes a shorter time to reply to the application program. In addition, when the host computer fails, data can be recovered based on the remote database and the update data that has not been reflected on the remote database yet.
However, Japanese Patent Unexamined Publication No. 6-214853 has a drawback in that the host computer has to wait for the acknowledgement from the remote computer. Still a time to reply to the application program is required due to a network delay time. It is demanded that the host computer can reply to the application program when storing the update data in the local disk.
General networks cause a delay in message transmission, so that a first message may not arrive first. A timing of making a copy of update data from a local disk onto a remote disk and an arrival timing of a message requesting reflection of the update data at the remote computer cannot be controlled. Even if the host computer transmits a message requesting the reflection of the update data after storing the update data in the local disk, the message may arrive faster than the update data. If the message arrives first, the remote computer updates a remote database based on inappropriate update data. This causes discrepancy between the host database and the remote database. Therefore, the host computer has to wait for an acknowledgement from the remote computer before continuing the processing.